/**
 * author wen
 * &copy; CUNYU GROUP
 * email wjd_13@hotmail.com
 */
package com.cunyu.action;

import com.cunyu.bean.Form;
import com.cunyu.bean.ReqData;
import com.cunyu.bean.RespData;
import com.cunyu.service.BillsService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 抢单券相关
 * @author win
 * 2019/05/11-10:04
 */
@Controller
public class BillsController extends BaseController{

    @Resource
    BillsService billsService ;

    @RequestMapping("/bills/list")
    public String list(Model model, Form form, ReqData reqData){
        RespData<List<Map<String, Object>>> respData = billsService.billsList(form, reqData);
        model.addAttribute("respData",respData);
        model.addAttribute("form",form) ;
        return "bills/list" ;
    }

    @RequestMapping("/bills/create")
    public void create(HttpServletResponse response){
        billsService.createBills();
        printOK(response,"success",10);
    }

}
